setlocal
if not "%1" == "" goto ok
echo  Usage: %0 version
exit /b 1
:ok

set zip="%ProgramFiles(x86)%\7-Zip\7z.exe"
if exist %zip% goto zip
set zip="%ProgramW6432%\7-Zip\7z.exe"
if exist %zip% goto zip
echo The 7z utility is missing. Please go to https://sourceforge.net/projects/sevenzip/ and install 7-Zip.
exit /b 1
:zip

md "..\redist"
set dst="..\redist\mirandasearch_src-%1.zip"
del /q %dst% 2>nul
%zip% a -y -mm=Deflate64 -mx=9 -mpass=15 -mfb=257 -r -tzip -x!.svn -x!setup\*.exe -x!images -x!bin -x!obj -x!Release -x!Debug -x!Win32 -x!x64 -x!ipch -x!*.aps -x!*.po_ -x!*.7z -x!*.log -x!*.bak -x!*.tmp -x!*.sdf -x!*.suo -x!*.ncb -x!*.user -x!*.opensdf %dst% .\
exit /b 0